#! /usr/bin/python

def base2Mul(n):
    cc = int(math.log(n, 2))
    rest = n - 2**cc
    while(rest > 0):
	 p = int(math.log(rest, 2))
	 cc += 1
	 rest = rest - 2**p
    return cc

ll = [[range(1, 10)] for i in range(10)]

path = [[range(1, i+1)] for i in range(10)]
print path

for :
    path.append()
    tmp = []
    for j in path[i]:
	path[i].append()

for i in range(1, len(path)):
    for j in path[i]:
	print j
        for k in [a for a in j if i+a<len(path)]: 
            if len(path[i][0])+1 < len(path[i+k][0]): path[i+k] = [j + [i+k]]
            elif len(path[i][0])+1 == len(path[i+k][0]): path[i+k].append(j + [i+k])
print sum(len(p[0])-1 for p in path[1:])

print path
